package com.alit.face.koala.projectvariable;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

/**
 * @author litong
 * @date 2019年4月22日_上午9:49:12
 * @version 1.0
 */
public class RuntimeVariableUtil {
	private static Map<String, String> variables = new HashMap<>();
	@SuppressWarnings("unused")
	private static ClassLoader classLoader = null;

	static {
		// 设置 classLoaderPath
		classLoader = RuntimeVariableUtil.class.getClassLoader();
		URL resource = RuntimeVariableUtil.class.getClassLoader().getResource("");
		variables.put(RuntimeVariableKeys.classLoaderPath, resource.toString());
	}

	public static Map<String, String> getVariables() {
		return variables;
	}

	public static void add(String key, String value) {
		variables.put(key, value);
	}

	public static String get(String key) {
		return variables.get(key);
	}
}
